<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    request.setAttribute("basePath", basePath);
%>
<!DOCTYPE>
<html>
<head>
    <title>明细信息</title>
    <%@ include file="/resources/js/easyui/taglibs.jsp" %>
    <%@ include file="/resources/js/easyui/_easyui.jsp" %>
    <%@ include file="/resources/js/easyui/_message.jsp" %>
    <%@ include file="/resources/js/easyui/_viewJS.jsp" %>
</head>

<body class="easyui-layout">
<form id="addform">
    <table class="tableForm" style="width: 100%;">
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>银行名称：</label></th>
            <td><input class="easyui-textbox" name="bankname" value="${bankcard.bankname}" style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>银行卡号：</label></th>
            <td><input class="easyui-textbox" name="bankcardnumber" value="${bankcard.bankcardnumber}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>持卡人：</label></th>
            <td><input class="easyui-textbox" name="cardholder" value="${bankcard.cardholder}" style="width:200px"/>
            </td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>联系电话：</label></th>
            <td><input class="easyui-textbox" name="mobile" value="${bankcard.mobile}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>身份证号码：</label></th>
            <td><input class="easyui-textbox" name="idcard" value="${bankcard.idcard}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>联行号：</label></th>
            <td><input class="easyui-textbox" name="payunionbank" value="${bankcard.payunionbank}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>归属地：</label></th>
            <td><input class="easyui-textbox" name="bankcountry" value="${bankcard.bankcountry}"
                       style="width:80px"/>
                <input class="easyui-textbox" name="bankprovince" value="${bankcard.bankprovince}"
                       style="width:80px"/>
                <input
                        class="easyui-textbox" name="bankcity" value="${bankcard.bankcity}"
                        style="width:80px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>开户行：</label></th>
            <td><input class="easyui-textbox" name="bankofdeposit" value="${bankcard.bankofdeposit}"
                       style="width:250px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>商户结算行：</label></th>
            <td><input class="easyui-textbox" name="bussinseclearingbank" value="${bankcard.bussinseclearingbank}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>账户类型：</label></th>
            <td>
                <input type="radio" name="accounttype" value="0"
                       <c:if test="${bankcard.accounttype == 0}">checked="checked"</c:if>>个人账户</input>
                <input type="radio" name="accounttype" value="1"
                       <c:if test="${bankcard.accounttype == 1}">checked="checked"</c:if>>对公账户</input>
            </td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>结算周期：</label></th>
            <td>
                <input type="radio" name="clearingcycle" value="0"
                       <c:if test="${bankcard.clearingcycle == 0}">checked="checked"</c:if>>T+N</input>

                <input type="radio" name="clearingcycle" value="1"
                       <c:if test="${bankcard.clearingcycle == 1}">checked="checked"</c:if>>T+1</input>

                <input type="radio" name="clearingcycle" value="2"
                       <c:if test="${bankcard.clearingcycle == 2}">checked="checked"</c:if>>T+2</input>

                <input type="radio" name="clearingcycle" value="3"
                       <c:if test="${bankcard.clearingcycle == 3}">checked="checked"</c:if>>T+3</input>

                <input type="radio" name="clearingcycle" value="7"
                       <c:if test="${bankcard.clearingcycle == 7}">checked="checked"</c:if>>T+7</input>

            </td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>金资清分类型：</label></th>
            <td>
                <input type="radio" name="capitalclearingtype" value="1"
                       <c:if test="${bankcard.capitalclearingtype == 1}">checked="checked"</c:if>>清分1</input>
                <input type="radio" name="capitalclearingtype" value="2"
                       <c:if test="${bankcard.capitalclearingtype == 2}">checked="checked"</c:if>>清分2</input>
            </td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>身份证正面照：</label></th>
            <td><input class="easyui-textbox" name="idcrardimgpositive" value="${bankcard.idcrardimgpositive}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>身份证反面照：</label></th>
            <td><input class="easyui-textbox" name="idcrardimgbehind" value="${bankcard.idcrardimgbehind}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>营业执照原件照：</label></th>
            <td><input class="easyui-textbox" name="businesslicense" value="${bankcard.businesslicense}"
                       style="width:200px"/></td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>审核状态：</label></th>
            <td>
                <c:if test="${bankcard.cardconfirmed == 0}">审核中</c:if>
                <c:if test="${bankcard.cardconfirmed != 0}">已审核</c:if>
                <input type="radio" name="confirmed" value="1"
                       <c:if test="${bankcard.cardconfirmed == 1}">checked="checked"</c:if>>通过</input>
                <input type="radio" name="confirmed" value="2"
                       <c:if test="${bankcard.cardconfirmed == 2}">checked="checked"</c:if>>未通过</input>
                <c:if test="${bankcard.cardconfirmed == 0}"><input type="button" value="确定"
                                                                   id="GC_verify_button"/></c:if>
            </td>
        </tr>
        <tr>
            <th align="right" valign="top"><span class="redStart">*</span><label>审核备注：</label></th>
            <td><input class="easyui-textbox" name="comment" value="${bankcard.comment}"
                       style="width:200px" placeholder="请填写审核备注"/></td>
        </tr>
        <input type="hidden" value="${bankcard.cardid}" name="cardid"/>
    </table>
</form>

<script type="application/javascript">
    
    $("#GC_verify_button").click(function () {
        $.ajax({
            url: '${basePath}web/giveinfo/verifyGiveInfo',
            type: 'POST',
            data: {
                "cardid":$("input[name='cardid']").val(),
                "cardconfirmed":$("input[name='confirmed']:checked").val(),
                "cardholder":$("input[name='cardholder']").val(),
                "mobile":$("input[name='mobile']").val()
            },
            async: false,
            traditional: true,
            error: function (response) {
                ViewHelper.func.ajaxErrorMessage(response);
            },
            success: function (ret) {
                if (ret.result) {
                    $.messager.alert('提示', "审核完成，并已短信通知用户", 'info');
                } else {
                    $.messager.alert('提示', ret.info, 'error');
                }
            }
        });
    });
    
    function add() {
        var formData = new FormData($("#addform")[0]);
        $.ajax({
            url: '${basePath}web/giveinfo/editGiveInfo',
            type: 'POST',
            data: $("#addform").serialize(),
            async: false,
            traditional: true,
            error: function (response) {
                ViewHelper.func.ajaxErrorMessage(response);
            },
            success: function (ret) {
                if (ret.result) {
                    parent.view.closeAddWin(1);
                    $("#addform").form('clear');
                    //$.messager.alert('提示信息！', "审核通过,请为该用户设置商户号", 'info');
                } else {
                    $.messager.alert('提示', ret.info, 'error');
                }
            }
        });
    }
</script>
</body>
</html>
